<?php
class XA_Table_Field_Simple extends XA_Table_Field {

	public $data_field;
	
	
	public function __construct($name, $label) {
		parent::__construct($name, $label);
		$this->data_field = $name;
	}



	public function out($row) {
		if (!array_key_exists($this->data_field, $row)) {
			e('ERROR: Missing field \''.$this->data_field.'\' ('.$this->label.') in table row', $row);
		}
		return '<td class="'.implode(' ', $this->class_list).'">'.nl2br($row[$this->data_field]).'</td>';
	}
}
